<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><s:text name="theme.list.title"/></title>
	<%@ include file="/common/meta.jsp"%>
	<%@ include file="/common/common.jsp"%>
</head>
<body>
<div id="wrapper">
	<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/main.action"><s:text name="homepage"/></a><span>></span><s:text name="theme.file.title"/></div>
	<div class="listtit" id="listtit"><p><span><strong><s:text name="theme.file.list.title"/></strong></span></p></div>
	<div class="searchbox">
   		<span>
			<a href="${ctx}/theme/file-manage.action"><s:tesxt name="rootDirectory"/> </a>
			<a href="${ctx}/theme/file-manage.action?mark=down&crruentpath=<s:property value='crruentpath'/>"><s:text name="backMainFile" /> </a>			 
		</span>
	</div>
	<div class="listbox" id="listbox">
		<table class="listgrid" id="listbox">
			<tbody>
				<tr>
					<th><s:text name="fileName"/></th>
					<th><s:text name="filePath"/></th>
					<th><s:text name="fileSize"/></th>
					<th><s:text name="lastModified"/></th>
					<th><s:text name="actionBar"/></th>
				</tr>
				<s:iterator value="fileBeanList">
					<tr>
					<td>
						<s:if test="editFlag">
							<a href="${ctx}/theme/file-input.action?crruentpath=<s:property value='path'/>">
								<s:property value="name"/>&nbsp;
							</a>
						</s:if>
						<s:elseif test="!fileFlag">
							<a href="${ctx}/theme/file-manage.action?mark=down&crruentpath=<s:property value='path'/>">
								<s:property value="name"/>&nbsp;
							</a>
						</s:elseif>
						<s:else><s:property value="name"/>&nbsp;
						</s:else>
					</td>
					<td><s:property value="path"/>&nbsp;</td>
					<td><s:property value="size"/>&nbsp;</td>
					<td><s:property value="lastModify"/>&nbsp;</td>
					<td>&nbsp;
						<s:if test="editFlag" >
						    <s:if test="%{authLicence('1_1_6',#{siteId})}">
							     <a  href="${ctx}/theme/file-input.action?assoFlag=associate&crruentpath=<s:property value='path'/>"><s:text name="fileEditor"/></a>
							</s:if>
							<s:else> <a  ><s:text name="fileEditor"/></a></s:else>
						</s:if> 
						<s:if test="deleteFlag">
							<s:if test="%{authLicence('1_1_6',#{siteId})}">
								<a href="javascript:deleteFile('<s:property value="deletePath"/>')"><s:text name="fileDelete"/></a>
							</s:if>
							<s:else><a><s:text name="fileDelete"/></a></s:else>
						</s:if>
					</td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</div>
	<div class="listoperateb ">
		<span>
			<a href="${ctx}/theme/file-manage.action"><s:text name="rootDirectory"/> </a>	
			<a href="${ctx}/theme/file-manage.action?mark=down&crruentpath=<s:property value='crruentpath'/>"><s:text name="backMainFile"/></a>		 
		</span>
	</div>
</div>
</body>
</html> 
<script type="text/javascript">
    function  deleteFile(path){
    	$.ajax({
    		url:"${ctx}/theme/file-delete.action?t="+new Date().getTime(),
    		data:{'crruentpath':path},
    		dataType:'text',
    		type:'post',
    		success:function(data){
    			var json = eval('('+data+')');
    			alert(json.msg);
    			if(json.flag){
    				window.location.reload(true);
    			}
    		}
    	});
    }
</script>
 